package com.xtrareports.exporters;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class CsvGenerator {
	public File generateCsv(String fileName) throws IOException{
		
		System.out.println( "using adaptee class :" + this.getClass());
		File file = new File(fileName);
		 
		FileWriter writer = new FileWriter(file);
		 
	    writer.append("DisplayName");
	    writer.append(',');
	    writer.append("Age");
	    writer.append('\n');
 
	    writer.append("Fares");
	    writer.append(',');
	    writer.append("30");
            writer.append('\n');
 
	    writer.append("YOUR NAME");
	    writer.append(',');
	    writer.append("29");
	    writer.append('\n');
 
	    //generate whatever data you want
 
	    writer.flush();
	    writer.close();
	    
	    return file;
		
	}

}
